<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>营业额</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="shortcut icon" href="{:sysconf('browser_icon')}"/>
    <link rel="stylesheet" href="__STATIC__/plugs/layui/css/layui.css?ver={:date('ymd')}"/>
    <script src="http://echarts.baidu.com/dist/echarts.js"></script>
</head>
<body>
<!-- 为ECharts准备一个具备大小（宽高）的Dom -->
<div style="text-align: center;font-size: 21px;margin: 10px auto"">{$time.start|date="Y-m-d",###} - {$time.end|date="Y-m-d",###}</div>
<div id="main" style="width:100%;height:500px;margin: 0 auto"></div>
</body>
</html>
<script>
    var myChart = echarts.init(document.getElementById('main'));
    myChart.title = '本月门店消费排名';
    option = {
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'cross',
                crossStyle: {
                    color: '#999'
                }
            }
        },
        toolbox: {
            feature: {
                dataView: {show: true, readOnly: false},
                magicType: {show: true, type: ['line', 'bar']},
                restore: {show: true},
                saveAsImage: {show: true}
            }
        },
        legend: {
            data:['交易额','交易量']
        },
        xAxis: [
            {
                type: 'category',
                data: {$title},
                axisPointer: {
                    type: 'shadow'
                }
            }
        ],
        yAxis: [
            {
                type: 'value',
                name: '交易额/元',
                min: 0,
                max: {$max_amount},
                interval: 40000,
                axisLabel: {
                    formatter: '{value} '
                }
            },
            {
                type: 'value',
                name: '交易量/单',
                min: 0,
                max: {$max_num},
                interval: 10,
                axisLabel: {
                    formatter: '{value} '
                }
            }
        ],
        series: [
            {
                name:'交易额',
                type:'line',
                data:{$totalmoney}
            },
            {
                name:'交易量',
                type:'bar',
                data:{$totalnum}
            }
        ]
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
</script>


